package cn.matezk.cloud.dao;

import cn.matezk.cloud.beans.ShareDevice;
import cn.matezk.cloud.model.UserDevice;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserDeviceDao {
    int bind(UserDevice userDevice);
    UserDevice match(String userId, String deviceId);
    List<UserDevice> matchRole(@Param("deviceId") String deviceId, @Param("role") Integer role);
    int unbind(@Param("deviceId") String deviceId, @Param("userId") String userId);
    int unbindByDeviceId(String deviceId);
    int unbindByUserId(String userId);
    int changeFamilyDeviceOwner(@Param("familyId") String familyId, @Param("fromUserId") String fromUserId, @Param("toUserId") String toUserId);
    int unbindByFamilyMember(@Param("familyId") String familyId, @Param("userId") String userId);
    int update(UserDevice userDevice);
    List<ShareDevice> shareDevice(String userId);
}
